home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Disc to the Future 2
/
Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin
/
MAC
/
THINKC
/
TCL1
/
CTCPSTRE
/
CTCPSTRE.H
< prev
Wrap
Text File
|
1990-06-28
|
2KB
|
59 lines
/****
* CTCPStream.h
*
* TCP Internet Protocal class.
*
****/
#define _H_CTCPStream /* Include this file only once */
#define NIL 0L
#include <MacTCPCommonTypes.h>
#include <UDPPB.h>
#include <TCPPB.h>
#include <GetMyIPAddr.h>
#include <AddressXlation.h>
#define Closed 0 /* connection states */
#define Listening 2
#define SYNReceived 4
#define SYNSent 6
#define Established 8
#define FINWait1 10
#define FINWait2 12
#define CloseWait 14
#define Closing 16
#define LastAck 18
#define TimeWait 20
struct CTCPStream : CObject {
TCPiopb tcppb;
tcp_port thePort;
struct hostInfo hp;
wdsEntry wds[2];
Boolean async;
char *IOBuffer;
int buffsize;
int Activity;
byte timeout;
OSErr ourError;
void ITCPStream(short size); /* initialize a stream */
void Dispose(void); /* get rid of it */
void Listen(tcp_port port); /* listen on a stream */
void Open(tcp_port port,char *host); /* open a remote stream */
void Release(void); /* release the stream */
int State(void); /* get the state */
void Close(void); /* politely close stream */
void Write(char *srcBuff, short len); /* write to the stream */
void Read(char *destBuff, short *len); /* read from the stream */
void SetTimeOut(byte secs); /* adjust the timeout value */
/* void ASR(StreamPtr tcpStream, Can't have an ASR routine as
unsigned short eventCode, a method! But here's how to
Ptr userDataPtr, declare one in Think C.
unsigned shortterminReason,
struct ICMPReport *icmpMsg);
*/
};